<template>
  <el-row class="mx__20 bg-white now-page-height" style="min-width: 1000px">
    <el-col class="current-content-style now-page-height">
      <el-row :gutter="20" type="flex" class="statistics" style="min-width: 100px">
      </el-row>
      <el-row :gutter="20" type="flex" class="statistics" style="min-width: 100px">
        <TongJiItem v-for="item in  list" :bg="item.bg">
          <template #countSlot>
            {{ item.value }} <small v-if="item.dw">{{ item.dw }}</small>
          </template>
          <template #textSlot>
            {{ item.title }}
          </template>
          <template #iconsSlot>
            <i :class="item.icons"></i>
          </template>
        </TongJiItem>
      </el-row>
    </el-col>
  </el-row>
</template>

<script>
import TongJiItem from './TongJiItem.vue';
export default {
  name: 'SiteView',
  data() {
    return {
      list: [
        { bg: '#a38cc6', title: '上月未缴费金额', value: 1341231, dw: '元', icons: 'el-icon-data-board' },
        { bg: '#ffca5b', title: '未使用水表数量', value: 12, icons: 'el-icon-crop' },
        { bg: '#4de5d5', title: '新安装水表数量', value: 1231, icons: 'el-icon-news' },
        { bg: ' #6ab8f7', title: '上月未缴费金额', value: 122, icons: 'el-icon-user' },
        { bg: '#fd3995', title: '上月用水量', value: 1231231, dw: '吨', icons: 'el-icon-data-board' },
      ]
    }
  },
  created() {
    console.log('工作台 created');
  },
  destroyed() {
    console.log('工作台 destroyed');
  },
  activated() {
    console.log('工作台 activated');

  },
  deactivated() {
    console.log('工作台 deactivated');
  },
  components: {
    TongJiItem
  },
  methods: {
    handler() {

    }
  }
}
</script>


<style scoped lang="less">
small {
  font-size: 16px;
  color: rgb(71, 68, 68);
}

.now-page-height {
  // height:
  min-height: calc(100% - 60px);
}

.statistics {
  flex-wrap: wrap;
  justify-content: start;
}

// /deep/ ,修改框架的样式时，加了这个，可以实现在使用scoped的情况下，让修改起作用。起到一个深入传递的作用。
/deep/ .statistics-item {
  position: relative;
  box-sizing: border-box;
  flex-basis: calc(33.3333% - 4%);
  min-width: 200px;
  margin: 20px 2%;
  padding: 50px 60px !important;
  // background-color: rgba(239, 229, 243, 0.699);
  border-radius: 5px;
  text-align: center;
  display: flex;
  flex-direction: row;
  justify-content: space-between;

  // &:nth-child(1) {
  //   background-color: #a38cc6;
  // }

  // &:nth-child(2) {
  //   background-color: #ffca5b;
  // }

  // &:nth-child(3) {
  //   background-color: #4de5d5;
  // }

  // &:nth-child(4) {
  //   background-color: #6ab8f7;
  // }

  // &:nth-child(5) {
  //   background-color: #fd3995;
  // }

  &>i {
    width: 80px;
    height: 80px;
    border-radius: 40px;
    text-align: center;
    padding-top: 0;
    line-height: 80px;
    border: 0px solid white;
    font-size: 80px;
    color: white;
    opacity: 0.7;
    position: relative;
    /*right取值是父级的左右padding值加10px*/
    right: -70px;
  }

  & p {
    color: #e4e6e7;
    margin: 0;
    font-size: 18px;
    // text-decoration: overline;
    border-top: 1px solid rgba(56, 4, 4, 0.87);
    padding-top: 5px;
    color: #ffffff;
  }

  & h3 {
    margin-top: 0px;
    margin-bottom: 10px;
    color: #ffffff;
    font-size: 30px;
    text-align: left;
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    font-weight: 500;
  }

  @media screen and (max-width: 1200px) {
    & h3 {
      font-size: 32px;
    }

    & p {
      font-size: 14px;
    }
  }
}
</style>
